﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Routing;
using System.Web.Security;
using System.Web.SessionState;
using Utility1;

namespace eDream
{
    public class Global : System.Web.HttpApplication
    {
        public static string SESS_SECURITY_CODE = "SESS_SECURITY_CODE";
        public static string SESS_USER = "SESS_USER";
        protected void Application_Start(object sender, EventArgs e)
        {
            // Code that runs on application startup
            /*
            RouteTable.Routes.MapPageRoute("Home", //route name
            "Trang-chu/{id}/{page}/", //route url 
            "~/index.aspx"); //file name
            
            RouteTable.Routes.MapPageRoute("He-thong", "He-thong/{idc}/{namec}/", "~/Canhan.aspx");
            RouteTable.Routes.MapPageRoute("He-thong-msmart", "He-thong-msmart/{namec}/", "~/Canhan.aspx");
            RouteTable.Routes.MapPageRoute("Index", "{pages}/{cateId}/{proname}", "~/index.aspx");
            RouteTable.Routes.MapPageRoute("Trang-chu", "{home}/", "~/index.aspx"); 
             */
        }

        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }

        public static string ToEncoding(string value)
        {
            return Encryption64.Encrypt(value, "1A2B3C4D-LeHoai0007899").ToLower();
        }

        public static string ToEncoding(string value, string value2)
        {
            return Encryption64.Encrypt(value, value2).ToLower();
        }
    }
}